import service from '@/utils/request'

export const getBenefits = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/platform_kanban/economic/benefits', data)
      .then(res => {
        resolve(res.data)
      })
  })
}
export const getPlantingTop = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/platform_kanban/planting/top6', data)
      .then(res => {
        resolve(res.data)
      })
  })
}
export const getYieldTop = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/platform_kanban/yield/top6', data)
      .then(res => {
        resolve(res.data)
      })
  })
}
export const getMapList = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/platform_kanban/map/data', data)
      .then(res => {
        resolve(res.data)
      })
  })
}

export const getLandUsed = (data) => {
  return new Promise((resolve, reject) => {
    service.get('/boss/planting_kanban/land?farmId=' + data.farmId)
      .then(res => {
        resolve(res.data)
      })
  })
}

export const getBudget = (data) => {
  return new Promise((resolve, reject) => {
    service.get('/boss/planting_kanban/budget?plantingPlanId=' + data.plantingPlanId)
      .then(res => {
        resolve(res.data)
      })
  })
}

export const getFertilizer = (data) => {
  return new Promise((resolve, reject) => {
    service.get(`/boss/planting_kanban/fertilizer?plantingPlanId=${data.plantingPlanId}&farmId=${data.farmId}`)
      .then(res => {
        resolve(res.data)
      })
  })
}

export const getMedicine = (data) => {
  return new Promise((resolve, reject) => {
    service.get(`/boss/planting_kanban/medicine?plantingPlanId=${data.plantingPlanId}&farmId=${data.farmId}`)
      .then(res => {
        resolve(res.data)
      })
  })
}

export const getProduce = (data) => {
  return new Promise((resolve, reject) => {
    service.get(`/boss/planting_kanban/produce?plantingPlanId=${data.plantingPlanId}&farmId=${data.farmId}`)
      .then(res => {
        resolve(res.data)
      })
  })
}

export const getGrowthList = (data) => {
  return new Promise((resolve, reject) => {
    service.get(`/boss/planting_kanban/growth?plantingPlanId=${data.plantingPlanId}&farmId=${data.farmId}`)
      .then(res => {
        resolve(res.data)
      })
  })
}

export const getFarmingList = (data) => {
  return new Promise((resolve, reject) => {
    service.get(`/boss/planting_kanban/farming?plantingPlanId=${data.plantingPlanId}&farmId=${data.farmId}`)
      .then(res => {
        resolve(res.data)
      })
  })
}
export const getPlanList = (data) => {
  return new Promise((resolve, reject) => {
    service.get(`/boss/planting_kanban/plan?farmId=${data.farmId}`)
      .then(res => {
        resolve(res.data)
      })
  })
}

export const getFarmComp = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/weather/farm-weather-farm-comp', data)
      .then(res => {
        resolve(res.data)
      })
  })
}
